package com.xiaoshuidi.cloud.module.member.enums.topics;

import cn.hutool.core.lang.Assert;
import com.xiaoshuidi.cloud.module.member.enums.SexEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @description: 审核状态
 * @author: Jax.Lan
 * @create: 2023-06-01 14:39
 **/
@Getter
@AllArgsConstructor
public enum TopicsCommentReviewStatusEnum {

    TO_BE_REVIEW(0, "待审核"), // 待审核
    REVIEW_PASSED(1, "审核通过"), // 审核通过
    REVIEW_FAILED(2, "审核不通过"); // 审核不通过

    /**
     * 状态
     */
    private final Integer status;
    private final String name;

    public static String getNameByCode(Integer code) {
        TopicsCommentReviewStatusEnum topicsCommentReviewStatusEnum = Arrays.stream(TopicsCommentReviewStatusEnum.values()).filter(p -> p.status.intValue() == code.intValue()).findFirst().orElse(null);
        Assert.isTrue(topicsCommentReviewStatusEnum != null, "TopicsCommentReviewStatusEnum:{}不存在", code);
        return topicsCommentReviewStatusEnum.getName();
    }

}
